package com.gf.user.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.gf.base.type.Activity;
import com.gf.user.dao.UserBaseDao;
import com.gf.user.service.AdminService;
@Transactional
@Service("adminService")
public class AdminServiceImpl implements AdminService {

	@Autowired
	private UserBaseDao userBaseDao;
	@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
	@Override
	public boolean freezeUser(long userId) {
		return userBaseDao.updateActivity(userId, Activity.FREEZED);
	}
	@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
	@Override
	public boolean thawUser(long userId) {
		return userBaseDao.updateActivity(userId, Activity.NORMAL);
	}

}
